item COMMAND '"method 'MUIM_Application_OpenConfigWindow'"' PORT ThumbNailMaker LABEL "MUI Prefs..."
endmenu
text help '"ThumbNailMaker v1.3 by\nLorens Johansson (http://members.xoom.com/snorslex)\nIf you use this program, you are required to\nEmail the author (SnorsleX@SoftHome.net). Otherwise,\nhow is he supposed to know to keep supporting\nThumbNailMaker ?!?\n\033rLorens Johansson"' label "\033c\033bThumbNailMaker v1.3\033n\n\033cLorens Johansson\n\033cFreely Distributable Emailware"
group REGISTER ID MAIR ATTRS MUIA_CycleChain 1 LABELS "GFXCon Settings,HTML Settings,General settings"
group
group ATTRS MUIA_Group_Columns 2
label "GFXCon path:"
string ID CPATH ATTRS MUIA_CycleChain 1 help '"The path to GFXCon, including the executeable file!"'
label "ThumbNail size X:"
string ID CSIZX ATTRS MUIA_CycleChain 1 help '"The horizontal size of the ThumbNails!"'
label "ThumbNail size Y:"
string ID CSIZY ATTRS MUIA_CycleChain 1 help '"The vertical size of the ThumbNails!"'
label "JPEG Quality:"
string ID CJPGQ ATTRS MUIA_CycleChain 1 help '"The quality of the thumbnails. (Only affects JPEG pictures!)"'
label "ThumbNail format:"
string ID CPICF ATTRS MUIA_CycleChain 1 help '"Which format the ThumbNails should be! For example gif or jpg."'
endgroup
endgroup
group
group horiz
group ATTRS MUIA_Group_Columns 4
label "Pics per page:"
string ID HPPP ATTRS MUIA_CycleChain 1 help '"How many ThumbNails each index page should have."'
label "Picture page:"
check ID HPP ATTRS 0x8042654b 0 MUIA_CycleChain 1 MUIA_Selected 1 help '"Check this if the pictures should have an HTML page!"'
endgroup
endgroup
group ATTRS MUIA_Group_Columns 4
label "X Resolution:"
string ID HXRES ATTRS MUIA_CycleChain 1 help '"Which horizontal resolution the page should be optimized for!"'
label "Frame border:"
string ID HBORD ATTRS MUIA_CycleChain 1 help '"How thick the border of the frames should be!"'
endgroup
group ATTRS MUIA_Group_Columns 2
label "BGColor:"
string ID HBGCO ATTRS MUIA_CycleChain 1 help '"Which color the HTML files BGs should be!"'
endgroup
group frame label "HTML Information"
group ATTRS MUIA_Group_Columns 2
label "Base:"
string ID HBASE ATTRS MUIA_CycleChain 1 help '"What text it would be in the base of the index HTML files! You can use HTML tags too."'
label "Header:"
string ID HHEAD ATTRS MUIA_CycleChain 1 help '"What text it would be in the header of the index HTML files! You can use HTML tags too."'
label "Footer:"
string ID HFOOT ATTRS MUIA_CycleChain 1 help '"What text it would be in the footer of the index HTML files! You can use HTML tags too."'
endgroup
endgroup
group frame label "HTML Picture page Information"
group ATTRS MUIA_Group_Columns 2
label "Base:"
string ID HPBAS ATTRS MUIA_CycleChain 1 help '"What text it would be in the base of the picture HTML files! You can use HTML tags too."'
label "Header:"
string ID HPHEA ATTRS MUIA_CycleChain 1 help '"What text it would be in the header of the picture HTML files! You can use HTML tags too."'
label "Footer:"
string ID HPFOO ATTRS MUIA_CycleChain 1 help '"What text it would be in the footer of the picture HTML files! You can use HTML tags too."'
endgroup
endgroup
endgroup
group
group ATTRS MUIA_Group_Columns 2
label "Filepattern:"
string ID GPATT ATTRS MUIA_CycleChain 1 help '"Which files the program should ignore! This is a normal requester pattern."'
label "Source directory:"
popasl ID GDIR ATTRS MUIA_CycleChain 1 help '"The directory where the pictures are!"'
endgroup
group ATTRS MUIA_Group_Columns 4
label "ThumbNail dest dir:"
string ID GTDR ATTRS MUIA_CycleChain 1 help '"The name of the subdirectory where the ThumbNails should be stored,\n ONLY a name no path or slash."'
label "Verbose:"
check ID VERBO ATTRS 0x8042654b MUIA_CycleChain 1 Selected 1 help '"Puts >NIL: in the commandline!"'
endgroup
endgroup
endgroup
group ATTRS MUIA_Group_Columns 3
button ID START ATTRS MUIA_CycleChain 1 help '"Starts making thumbnails and HTML pages if chosen!"' COMMAND """ThumbNailMaker.rexx START""" label "Start"
button ID ABT ATTRS MUIA_CycleChain 1 help '"Shows some info about ThumbNailMaker."' COMMAND """ThumbNailMaker.rexx ABOUT""" label "About"
button ID QUIT ATTRS MUIA_CycleChain 1 help '"Quits ThumbNailMaker."' COMMAND '"quit"' PORT ThumbNailMaker label "Quit"
endgroup
endwindow
options results;address ThumbNailMaker;
if open(set,'envarc:ThumbNailMaker/Strings', 'R') then do;
Address ThumbNailMaker string ID CPATH content readln(set);
Address ThumbNailMaker string ID CSIZX content readln(set);
Address ThumbNailMaker string ID CSIZY content readln(set);
Address ThumbNailMaker string ID CJPGQ content readln(set);
Address ThumbNailMaker string ID CPICF content readln(set);
Address ThumbNailMaker string ID HPPP content readln(set);
test = readln(set)
if test = 1 then Address ThumbNailMaker check ID HPP ATTRS MUIA_Selected 1
Address ThumbNailMaker string ID HXRES content readln(set);
Address ThumbNailMaker string ID HBORD content readln(set);
Address ThumbNailMaker string ID HBGCO content readln(set);
Address ThumbNailMaker string ID HBASE content readln(set);
Address ThumbNailMaker string ID HHEAD content readln(set);
Address ThumbNailMaker string ID HFOOT content readln(set);
Address ThumbNailMaker string ID HPBAS content readln(set);
Address ThumbNailMaker string ID HPHEA content readln(set);
Address ThumbNailMaker string ID HPFOO content readln(set);
Address ThumbNailMaker string ID GPATT content readln(set);
Address ThumbNailMaker popasl ID GDIR content readln(set);
Address ThumbNailMaker string ID GTDR content readln(set);
test = readln(set)
if test = 1 then Address ThumbNailMaker check ID VERBO ATTRS MUIA_Selected 1
call close(set);
end;
Address ThumbNailMaker
EXIT
Tags:
MUIA_Application_Sleep = 0x80425711
MUIA_AppMessage = 0x80421955
MUIA_Frame = 0x8042ac64
MUIA_Numeric_Value = 0x8042ae3a
MUIA_Menuitem_Title = 0x804218be
MUIA_Menuitem_Shortcut = 0x80422030
MUIA_Selected = 0x8042654b
MUIA_CycleChain = 0x80421ce7
MUIA_Group_Columns = 0x8042f416
MUIA_Group_Rows = 0x8042b68f
MUIA_Disabled = 0x80423661
MUIA_Cycle_Active = 0x80421788
MUIM_Application_AboutMUI = 0x8042d21d
MUIM_Application_OpenConfigWindow = 0x804299ba
TRUE = 1
FALSE = 0
Return 0
c:
address ThumbNailMaker;check id arg(1);
if result = 1 then ct = ct || arg(2);
return 0;
exit
Req:
request ID REQU TITLE '"' arg(1) '"' GADGETS '"_OK"' STRING arg(2)
Return 0
Readstrings:
address ThumbNailMaker;
string ID CPATH
GFXCON = result
string ID CSIZX
sizex = result
string ID CSIZY
sizey = result
string ID CJPGQ
QUALITY = result
string ID CPICF
FORMAT = result
string ID HPPP
perpage = result
check ID HPP
picpage = result
string ID HXRES
res = result
string ID HBORD
BORDER = result
string ID HBGCO
BGCOLOR = result
string ID HBASE
BASE = result
string ID HHEAD
HEADER = result
string ID HFOOT
FOOTER = result
string ID HPBAS
PBASE = result
string ID HPHEA
PHEADER = result
string ID HPFOO
PFOOTER = result
string ID GPATT
PATTERN = result
popasl ID GDIR
directory = result
string ID GTDR
dest = result
check ID VERBO
VERBOSE = result
return
prefs:
if arg(1) = "s" then call open(set,'envarc:ThumbNailMaker/Strings',w);
if arg(1) = "u" then call open(set,'env:ThumbNailMaker/Strings',w);
address ThumbNailMaker;
string ID CPATH
call writeln(set,result);
string ID CSIZX
call writeln(set,result);
string ID CSIZY
call writeln(set,result);
string ID CJPGQ
call writeln(set,result);
string ID CPICF
call writeln(set,result);
string ID HPPP
call writeln(set,result);
check ID HPP
call writeln(set,result);
string ID HXRES
call writeln(set,result);
string ID HBORD
call writeln(set,result);
string ID HBGCO
call writeln(set,result);
string ID HBASE
call writeln(set,result);
string ID HHEAD
call writeln(set,result);
string ID HFOOT
call writeln(set,result);
string ID HPBAS
call writeln(set,result);
string ID HPHEA
call writeln(set,result);
string ID HPFOO
call writeln(set,result);
string ID GPATT
call writeln(set,result);
popasl ID GDIR
call writeln(set,result);
string ID GTDR
call writeln(set,result);
check ID VERBO
call writeln(set,result);
call close(set);
return
start:
form="."||format
form=compress(form,"e")
files=filelist(directory''PATTERN,filenames,F,)
if (files==0) then do
say "No files to process!"
exit 0
end
if ~exists(directory||dest) then call makedir(directory||dest)
dest=dest||"/"
call sort()
say "Checking for new pictures..."
do f=1 to files
name= filenames.f
name2 = name
plats = pos(':',name2)
if plats ~= '0' then name2 = delstr(name2, 1, plats)
do until pos('/',name2) = '0'
plats = pos('/',name2)
if plats ~= '0' then name2 = delstr(name2, 1, plats)
end
call pragma("STACK",22000)
parse var name2 file "." .
file2 = file
plats = pos(':',file2)
if plats ~= '0' then file2 = delstr(file2, 1, plats)
do until pos('/',file2) = '0'
plats = pos('/',file2)
if plats ~= '0' then file2 = delstr(file2, 1, plats)
end
names.f="t_"||file2||FORM
if ~exists(directory||dest||names.f) then do
comm = GFXCON||' "'||name'"'
IF(VERBOSE==1) THEN do
comm = comm||' >NIL:'
say "Processing file "name2
end
comm = comm||' TO "'||directory||dest||names.f||'" FORMAT 'FORMAT
IF (UPPER(FORM)==".JPG") THEN DO
comm = comm||' QUALITY 'QUALITY||' '
END
comm = comm||' BOXFIT '||sizex||' '||sizey
ADDRESS COMMAND comm
end
if ~exists(directory''dest||names.f) then say "Error, GfxCon could not create the thumbnail!"
END
if res="" then res=800
if perpage ==0 then perpage=files
number=1
pagefiles=perpage
pages=files%perpage
if files//perpage ~=0 then pages=pages+1
line="0a"x||"Creating "pages" index page"
if pages>1 then line=line||"(s)"
if picpage==1 then line=line||" and "files" picture pages"
say line||"0a"x
do p=1 to pages
if files-(perpage*p)<0 then pagefiles=files//perpage
if pagefiles>0 then do
max = res % ((border*2)+sizex+7)
if (pagefiles//max) ~=0 then do
mostremainders=pagefiles//max
do temp=max to 2 by -1
if pagefiles//temp > mostremainders then do
mostremainders=pagefiles//temp
max=temp
end
end
end
rows = pagefiles%max
if pagefiles//max ~=0 then rows=rows+1
indexfile="output"
if open(indexfile,directory||"t_index"||p||".html","W") then do